package io.renren.modules.school.controller;

import io.renren.common.utils.R;
import io.renren.modules.school.service.ProvinceAndCitiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("school/provinceAndCities")
public class ProvinceAndCitiesController {

    @Autowired
    ProvinceAndCitiesService provinceAndCitiesService;

    @RequestMapping("/getProvinces")
    R getProvinces(@RequestBody Map region) {
        return R.ok().put("data", provinceAndCitiesService.getProvinces(region));
    }

    @RequestMapping("/getCities")
    R getCities(@RequestBody Map region) {
        return R.ok().put("data", provinceAndCitiesService.getCities(region));
    }

}
